import { h } from 'vue'

export const menuConfig = {
  headList: [
    {
      label: '菜单名称',
      prop: 'name'
    },
    {
      label: '菜单编码',
      prop: 'code'
    },
    {
      label: '菜单路径',
      prop: 'path'
    },
    {
      label: '是否可见',
      prop: 'is_visible',
      slot: true,
      render: (row) => {
        const isVisible = row.is_visible
        return h(
          'el-tag',
          {
            class: isVisible
              ? 'el-tag el-tag--success el-tag--light'
              : 'el-tag el-tag--info el-tag--light'
          },
          isVisible ? '显示' : '隐藏'
        )
      }
    },
    {
      label: '菜单层级',
      prop: 'level'
    },
    {
      label: '排序',
      prop: 'sort_order'
    },
    {
      label: '菜单描述',
      prop: 'description'
    }
  ]
}

export const dictionaryConfig = {
  headList: [
    {
      label: '字典名称',
      prop: 'name'
    },
    {
      label: '字典编码',
      prop: 'code'
    },
    {
      label: '字典描述',
      prop: 'description'
    }
  ]
}
